package me.firstapp.module.bbs;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "BBS_NOTIFICATION")
public class BbsNotification extends BaseNotification {

	private static final long serialVersionUID = 1L;

	// 发起通知的用户
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FROM_MEMBER_ID", nullable = false, referencedColumnName = "ID")
	private Member fromMember;

	// 通知动作，0为收藏帖子，1为评论帖子，2为回复他人
	@Column(name = "ACTION", columnDefinition = "TINYINT", nullable = false)
	private Integer action;

	// 关联的帖子
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TOPIC_ID", nullable = false, referencedColumnName = "ID")
	private Topic topic;

	public Member getFromMember() {
		return fromMember;
	}

	public void setFromMember(Member fromMember) {
		this.fromMember = fromMember;
	}

	public Integer getAction() {
		return action;
	}

	public void setAction(Integer action) {
		this.action = action;
	}

	public Topic getTopic() {
		return topic;
	}

	public void setTopic(Topic topic) {
		this.topic = topic;
	}

}
